import * as http from '@api/http'

/**
 * @purpose 获取退款订单列表
 * @param status
 * @param page
 * @param size
 * @returns {*}
 */
export function items (status, page, size) {
  return http
    .get('activityOrderRefund.items', {
      status: status,
      page: page,
      size: size
    })
    .then(r => r.data)
}

/**
 * @purpose 获取取消订单中的出现人
 * @param refundId
 * @returns {*}
 */
export function cancelTravelItems (refundId) {
  return http
    .get('activityOrderRefund.cancelTravelItems', {
      refund_id: refundId
    })
    .then(r => r.data)
}

/**
 * @purpose 同意退款
 * @param refundId
 * @returns {Promise<T>}
 */
export function agree (refundId) {
  return http
    .post('activityOrderRefund.agree', {
      refund_id: refundId
    })
    .then(r => r.data)
}

/**
 * @purpose 同意退款
 * @param refundId
 * @returns {Promise<T>}
 */
export function refuse (refundId, reason) {
  return http
    .post('activityOrderRefund.refuse', {
      refund_id: refundId,
      reason: reason
    })
    .then(r => r.data)
}
